The approaches described in this section are approaches that could be pursued, but not necessarily approaches that have been previously conceived or pursued. Therefore, unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section.
In a procedure referred to as data replication, modern enterprises replicate data that is primarily updated and/or accessed at a storage system, referred to herein as a “primary data system” (“primary system” or “primary”). Data is replicated or duplicated at another storage system or location, referred to herein as “replica data system” (“standby system” or “standby”). The data stored at the primary system is referred to herein as primary data or a primary copy and the data stored at the replica system is referred to as replica data or a replica copy.
Database systems (DBMSs) are often protected using replication. Typically, one DBMS maintains the primary copy of database files and one or more other database systems referred to herein as a standby system, each maintains a replica of the database files of the primary copy. The standby database system is used to back up (or minor) information stored in the primary database system or other primary copy.
For a DBMS protected using replication, data files, redo log files and control files are stored in separate, logically or physically identical images on separate physical media. In the event of a failure of the primary database system, the information is preserved, in duplicate, on the standby database system, which can be used in place of the primary database system.
The standby database system is kept up to date to accurately and timely reproduce the information in the primary database system. Typically, redo log records (also referred to herein as “redo records” or more generally as “change records”) are transmitted automatically from the primary database system to the standby database system. Information from the redo logs regarding changes that were made on the primary database system are used to replicate changes to the standby database system.
There are two types of standby database systems, a physical standby database system and logical standby database systems, which differ in the way they replicate information. In a logical replication system, operations performed on the primary system are sent to the standby system, and these operations are then performed again on the standby system. Thus, the standby system need only be logically identical, but not physically identical.
In a physical standby database system, changes are made using physical replication. For physical replication, updates made to a data unit of contiguous storage (herein “data blocks”) at the primary database system are made to corresponding data block replicas stored at the replica system. In the context of database systems, changes made to data blocks on the primary database system are replicated in replicas of those data blocks on the physical standby database system.
A data block is an atomic unit of persistent contiguous storage used by a DBMS to store database records (e.g. rows of a table). Information stored on the primary database system is thus replicated at the lowest atomic level of database storage space and a physical standby database system is essentially a physical replica of the primary database system. When records are read from persistent storage, a data block containing the record is copied into a buffer of DBMS's buffering system. The buffer usually contains many other rows and control and formatting information (e.g., offsets to sequences of bytes representing rows or other data structures, lists of transactions affecting rows). To read one record, the entire data block in which the row is stored must be read into the buffer.
To replicate changes from the primary database system, the standby database system scans the redo records generated for the primary database system. Redo records record changes to data blocks between a previous version of a data block and a subsequent version of the data block. A redo record contains enough information to reproduce the change to a copy of the previous version. Storing a redo record to persistent storage is part of an operation referred to herein as “persisting” the redo/change record. Persisting the change record on the standby database system ensures that the change record itself is not lost if the standby database system should restart, but persisting the change record on the standby database system does not update the state of the data used to process queries. To update the state of the data, the information contained within a redo record is used to reproduce a change to the previous version of the data block to produce the subsequent version of the data block. Updating the contents of the data block in this way is an operation referred to herein as applying the redo record.